manage_{$this->screen->id}_sortable_columns
Filter HookDescription
Filters the list table sortable columns for a specific screen. The dynamic portion of the hook name, `$this->screen->id`, refers to the ID of the current screen.Hook Information
File Location |
wp-admin/includes/class-wp-list-table.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1344 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$sortable_columns
|
An array of sortable columns. |
Usage Examples
Basic Usage
<?php
// Hook into manage_{$this->screen->id}_sortable_columns
add_filter('manage_{$this->screen->id}_sortable_columns', 'my_custom_filter', 10, 1);
function my_custom_filter($sortable_columns) {
// Your custom filtering logic here
return $sortable_columns;
}
Source Code Context
wp-admin/includes/class-wp-list-table.php:1344
- How this hook is used in WordPress core
<?php
1339 *
1340 * @since 3.1.0
1341 *
1342 * @param array $sortable_columns An array of sortable columns.
1343 */
1344 $_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );
1345
1346 $sortable = array();
1347 foreach ( $_sortable as $id => $data ) {
1348 if ( empty( $data ) ) {
1349 continue;
PHP Documentation
<?php
/**
* Filters the list table sortable columns for a specific screen.
*
* The dynamic portion of the hook name, `$this->screen->id`, refers
* to the ID of the current screen.
*
* @since 3.1.0
*
* @param array $sortable_columns An array of sortable columns.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-admin/includes/class-wp-list-table.php
Related Hooks
Related hooks will be displayed here in future updates.